import { createStore } from 'vuex'
import createPersistedstate from 'vuex-persistedstate'

import user from './modules/user'
import courses from './modules/courses'
import history from './modules/history'

export default createStore({
  state: () => {
  },
  getters: {
  },
  mutations: {
  },
  actions: {
  },
  modules: {
    user,
    courses,
    // 翻译历史记录持久化
    history
  },
  plugins: [
    createPersistedstate({
      key: 'iword-client-pc-store',
      path: ['user', 'courses', 'history']
    })
  ]
})
